﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace road2.Model
{
    class CarGenerator : BaseRoadObj
    {
        private int _vpi;
        public int vpi
        {
            get { return _vpi; }
            set
            {
                _vpi = value;
                RaisePropertyChanged("vpi");
            }
        }

        private Road _road;
        public Road road
        {
            get { return _road; }
            set
            {
                _road = value;
                RaisePropertyChanged("road");
            }
        }

        private int _x;
        public int x
        {
            get { return _x; }
            set
            {
                _x = value;
                RaisePropertyChanged("x");
            }
        }

        private int _y;
        public int y
        {
            get { return _y; }
            set
            {
                _y = value;
                RaisePropertyChanged("y");
            }
        }

        public CarGenerator(Guid id)
            : base(id)
        {

        }

        public Car GenCar()
        {
            if (this.road == null)
            {
                return null;
            }

            Car car = new Car(Guid.NewGuid(), CarTypes.small, 0, 20, 10, -10);
            car.road = this.road;
            // make a decision
            car.line = 0;

            return car;
        }
    }
}
